

\section{Python版本查询}
\begin{verbatim}
shell执行：python -V
Python脚本：import sys;print sys.version
\end{verbatim}

\section{Python额外包安装}
\begin{verbatim}
pip install package
\end{verbatim}


\section{Python类型判断}
\begin{verbatim}
>>>a=1
>>> isinstance(a,int)
True
>>> isinstance(a,(int,float))
True
>>> type(a)
<type 'int'>
>>> type(int())
<type 'int'>
>>> class AClass():
...     pass
... 
>>> a=AClass
>>> type(a)
<type 'classobj'>
>>> isinstance(a, AClass)
False
>>> b=AClass()
>>> isinstance(b, AClass)
True
\end{verbatim}

\section{Python特殊矩阵}
\begin{verbatim}
buckets = [0] * 100 #这种矩阵可能会出现赋值异常，即会保持所有值恒等。
buckets = [[0 for col in range(5)] for row in range(10)]

w, h = 100, 100
bucket = [[None] * w for i in range(h)]

import numpy
zarray = numpy.zeros(100)


\end{verbatim}









